<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB R2019b"><title>Object Detector</title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: pre-wrap; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: 400; text-align: left;  }
.S1 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;  }
.S2 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left;  }
.S3 { margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  }
.S4 { margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S5 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S6 { color: rgb(64, 64, 64); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 16.996px;  }
.embeddedOutputsErrorElement {min-height: 18px; max-height: 250px; overflow: auto;}
.embeddedOutputsErrorElement.inlineElement {}
.embeddedOutputsErrorElement.rightPaneElement {}
.embeddedOutputsWarningElement{min-height: 18px; max-height: 250px; overflow: auto;}
.embeddedOutputsWarningElement.inlineElement {}
.embeddedOutputsWarningElement.rightPaneElement {}
.diagnosticMessage-wrapper {font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px;}
.diagnosticMessage-wrapper.diagnosticMessage-warningType {color: rgb(255,100,0);}
.diagnosticMessage-wrapper.diagnosticMessage-warningType a {color: rgb(255,100,0); text-decoration: underline;}
.diagnosticMessage-wrapper.diagnosticMessage-errorType {color: rgb(230,0,0);}
.diagnosticMessage-wrapper.diagnosticMessage-errorType a {color: rgb(230,0,0); text-decoration: underline;}
.diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {white-space: pre-wrap;}
.diagnosticMessage-wrapper .diagnosticMessage-stackPart {white-space: pre;}
.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {white-space: pre; word-wrap: initial; min-height: 18px; max-height: 250px; overflow: auto;}
.textElement,.rtcDataTipElement .textElement {padding-top: 3px;}
.embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {}
.inlineElement .textElement {}
.embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {min-height: 16px;}
.rightPaneElement .textElement {padding-top: 2px; padding-left: 9px;}
.S7 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S8 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S9 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S10 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 16.996px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.variableValue { width: 100% !important; }
.embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {min-height: 18px; box-sizing: border-box;}
.embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper .matrixElement,.rtcDataTipElement .matrixElement {position: relative;}
.matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {white-space: pre; display: inline-block; vertical-align: top; overflow: hidden;}
.embeddedOutputsMatrixElement.inlineElement {}
.embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {display: none;}
.embeddedOutputsMatrixElement.inlineElement .veTable .body {padding-top: 0 !important; max-height: 100px;}
.inlineElement .matrixElement {max-height: 300px;}
.embeddedOutputsMatrixElement.rightPaneElement {}
.rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {overflow: hidden; padding-left: 9px;}
.rightPaneElement .matrixElement {margin-bottom: -1px;}
.embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {white-space: nowrap; margin-bottom: 3px;}
.embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {display: none;}
.embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {display:none;}
.embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {margin-bottom: -3px;}
.eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {cursor: default !important;}
.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {display: inline-block; margin-top: 3px; width: 30px; height: 12px; background-repeat: no-repeat; background-image: url("");}
.matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {margin-left: 35px; width: 12px; height: 30px; background-repeat: no-repeat; background-image: url("");}
.S11 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span>Object Detector</span></h1><div  class = 'S1'><span>Copyright 2018-2019 The MathWorks, Inc.</span></div><h2  class = 'S2'><span>Overview</span></h2><div  class = 'S1'><span>The Object Detector allows you to simulate vision-based object detectors for visualization and algorithm prototyping. It includes a MATLAB and Simulink interface.</span></div><div  class = 'S1'><img class = "imageNode" src = "" width = "549" height = "451" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S1'><span style=' font-weight: bold;'>Properties:</span></div><ul  class = 'S3'><li  class = 'S4'><span style=' font-weight: bold;'>Map: </span><span>A </span><a href = "matlab: doc robotics.OccupancyGrid"><span style=' font-family: monospace;'>robotics.OccupancyGrid</span></a><span> or </span><a href = "matlab: doc robotics.BinaryOccupancyGrid"><span style=' font-family: monospace;'>robotics.BinaryOccupancyGrid</span></a></li><li  class = 'S4'><span style=' font-weight: bold;'>Object detector offset:</span><span> A 2-by-1 array of </span><span texencoding="[x; y]" style="vertical-align:-5px"><img src="" width="35.5" height="17.5" /></span><span> offset from the vehicle</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Object detector angle:</span><span> Sensor orientation, in radians, relative to the vehicle </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);">x</span><span>-axis </span></li><li  class = 'S4'><span style=' font-weight: bold;'>Sensor field of view:</span><span> Sensor angular range, in radians, symmetric about the sensor </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);">x</span><span>-axis</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Maximum range:</span><span> The sensor maximum range, in meters.</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Maximum number of detections:</span><span> The maximum object detections returned. Detections are sorted from nearest to farthest.</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Sample time: </span><span>Sensor sample time (Simulink only)</span></li></ul><div  class = 'S1'><span style=' font-weight: bold;'>Inputs:</span></div><ul  class = 'S3'><li  class = 'S4'><span style=' font-weight: bold;'>Pose: </span><span>A 3-by-1 array representing the robot pose </span><span texencoding="[x; y; \theta]" style="vertical-align:-5px"><img src="" width="50" height="17.5" /></span><span>, in meters and radians respectively</span></li><li  class = 'S4'><span style=' font-weight: bold;'>Objects:</span><span> An N-by-3 array whose rows represent the </span><span texencoding="[x, y, label]" style="vertical-align:-5px"><img src="" width="71" height="17.5" /></span><span> of objects. The label is an integer value (1, 2, 3, etc.) which is used to simulate object correspondence such as color, markers, etc.</span></li></ul><div  class = 'S1'><span style=' font-weight: bold;'>Outputs:</span></div><ul  class = 'S3'><li  class = 'S4'><span style=' font-weight: bold;'>Detections: </span><span>A variable-sized array up to size </span><span style=' font-family: monospace;'>maxDetections</span><span>-by-3. Each row corresponds to </span><span style=' font-family: monospace;'>[range,angle,label]</span><span> of an object detection. Range is in meters, and angle is in radians.</span></li></ul><h2  class = 'S2'><span>MATLAB Usage</span></h2><div  class = 'S1'><span>Create an </span><span style=' font-family: monospace;'>ObjectDetector</span><span> object.</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S5'><span style="white-space: pre;"><span>detector = ObjectDetector</span></span></div><div  class = 'S6'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="9059B23C" data-testid="output_0" data-width="428" data-height="135" data-hashorizontaloverflow="false" style="width: 458px; max-height: 261px;"><div class="textElement"><div><span class="variableNameElement">detector = </span></div><div>  ObjectDetector with properties:

          mapName: ''
     sensorOffset: [0 0]
      sensorAngle: 0
      fieldOfView: 1.0472
         maxRange: 5
    maxDetections: 3</div></div></div></div></div></div><div  class = 'S1'><span>Configure the sensor properties.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: pre;"><span>load </span><span style="color: rgb(160, 32, 240);">exampleMap</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>detector.mapName = </span><span style="color: rgb(160, 32, 240);">'map'</span><span>;</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>detector.sensorOffset = [0,0];</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>detector.sensorAngle = 0;</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>detector.fieldOfView = pi/3;</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>detector.maxRange = 4;</span></span></div></div><div class="inlineWrapper"><div  class = 'S9'><span style="white-space: pre;"><span>detector.maxDetections = 3;</span></span></div></div></div><div  class = 'S1'><span>Simulate and display the object detections the map and vehicle pose.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: pre;"><span>objects = [3, 5, 1; 2, 5, 2; 3, 4, 3]; </span><span style="color: rgb(60, 118, 61);">% Each row is [x, y, label]</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>pose = [2; 4; pi/6];</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S10'><span style="white-space: pre;"><span>detections = detector(pose,objects)</span></span></div><div  class = 'S6'><div class="inlineElement eoOutputWrapper embeddedOutputsMatrixElement" uid="B45FE4DA" data-testid="output_1" data-width="428" style="width: 458px;"><div class="matrixElement veSpecifier"><div class="veVariableName variableNameElement" style="width: 428px;"><span>detections = </span><span class="veVariableValueSummary"></span></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:65.9749984741211,&quot;totalColumns&quot;:&quot;3&quot;,&quot;totalRows&quot;:&quot;2&quot;,&quot;charsPerColumn&quot;:10}"><div class="variableValue" style="width: 199.925px;">    1.0000   -0.5236    1.0000
    1.4142    0.2618    3.0000</div><div class="horizontalEllipsis hide"></div><div class="verticalEllipsis hide"></div></div></div></div></div></div></div><div  class = 'S1'><span>Simulate and display the object detections, map, and vehicle pose.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S7'><span style="white-space: pre;"><span>viz = Visualizer2D;</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>viz.mapName = </span><span style="color: rgb(160, 32, 240);">'map'</span><span>;</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>attachObjectDetector(viz,detector);</span></span></div></div><div class="inlineWrapper"><div  class = 'S8'><span style="white-space: pre;"><span>viz.objectColors = [1, 0, 0; 0, 1, 0; 0, 0, 1]; </span><span style="color: rgb(60, 118, 61);">% Row 1: Red, Row 2: Green, Row 3: Blue</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S10'><span style="white-space: pre;"><span>viz(pose,objects)</span></span></div><div  class = 'S6'><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="EAB18213" data-testid="output_2" style="width: 458px;"><div class="figureElement"><img class="figureImage figureContainingNode" src="" style="width: 560px;"></div></div></div></div></div><div  class = 'S11'><span style=' font-weight: bold;'>Examples</span></div><ul  class = 'S3'><li  class = 'S4'><a href = "matlab:edit mrsExampleObjectDetector"><span>Object detector MATLAB example</span></a></li></ul><h2  class = 'S2'><span>Simulink Usage</span></h2><div  class = 'S1'><span>Use the </span><span style=' font-weight: bold;'>Object Detector</span><span> block from the </span><span style=' font-weight: bold;'>Environments</span><span> section of the </span><a href = "matlab:mobileRoboticsLib"><span>block library</span></a><span>. </span></div><div  class = 'S1'><img class = "imageNode" src = "" width = "697" height = "362" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S1'><img class = "imageNode" src = "" width = "734" height = "266" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S1'><span style=' font-weight: bold;'>Examples</span></div><ul  class = 'S3'><li  class = 'S4'><a href = "matlab:mrsObjectModel"><span>Model with Object Detector block</span></a></li><li  class = 'S4'><a href = "matlab:mrsLidarAndObjectModel"><span>Model with Lidar Sensor and Object Detector blocks</span></a></li><li  class = 'S4'><a href = "matlab:mrsObjectTrackingModel"><span>Object tracking logic example</span></a></li></ul></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% Object Detector
% Copyright 2018-2019 The MathWorks, Inc.
%% Overview
% The Object Detector allows you to simulate vision-based object detectors for 
% visualization and algorithm prototyping. It includes a MATLAB and Simulink interface.
% 
% 
% 
% *Properties:*
%% 
% * *Map:* A <matlab: doc robotics.OccupancyGrid |robotics.OccupancyGrid|> or 
% <matlab: doc robotics.BinaryOccupancyGrid |robotics.BinaryOccupancyGrid|>
% * *Object detector offset:* A 2-by-1 array of $[x; y]$ offset from the vehicle
% * *Object detector angle:* Sensor orientation, in radians, relative to the 
% vehicle $x$-axis 
% * *Sensor field of view:* Sensor angular range, in radians, symmetric about 
% the sensor $x$-axis
% * *Maximum range:* The sensor maximum range, in meters.
% * *Maximum number of detections:* The maximum object detections returned. 
% Detections are sorted from nearest to farthest.
% * *Sample time:* Sensor sample time (Simulink only)
%% 
% *Inputs:*
%% 
% * *Pose:* A 3-by-1 array representing the robot pose $[x; y; \theta]$, in 
% meters and radians respectively
% * *Objects:* An N-by-3 array whose rows represent the $[x, y, label]$ of objects. 
% The label is an integer value (1, 2, 3, etc.) which is used to simulate object 
% correspondence such as color, markers, etc.
%% 
% *Outputs:*
%% 
% * *Detections:* A variable-sized array up to size |maxDetections|-by-3. Each 
% row corresponds to |[range,angle,label]| of an object detection. Range is in 
% meters, and angle is in radians.
%% MATLAB Usage
% Create an |ObjectDetector| object.

detector = ObjectDetector
%% 
% Configure the sensor properties.

load exampleMap
detector.mapName = 'map';
detector.sensorOffset = [0,0];
detector.sensorAngle = 0;
detector.fieldOfView = pi/3;
detector.maxRange = 4;
detector.maxDetections = 3;
%% 
% Simulate and display the object detections the map and vehicle pose.

objects = [3, 5, 1; 2, 5, 2; 3, 4, 3]; % Each row is [x, y, label]
pose = [2; 4; pi/6];
detections = detector(pose,objects)
%% 
% Simulate and display the object detections, map, and vehicle pose.

viz = Visualizer2D;
viz.mapName = 'map';
attachObjectDetector(viz,detector);
viz.objectColors = [1, 0, 0; 0, 1, 0; 0, 0, 1]; % Row 1: Red, Row 2: Green, Row 3: Blue
viz(pose,objects)
%% 
% *Examples*
%% 
% * <matlab:edit mrsExampleObjectDetector Object detector MATLAB example>
%% Simulink Usage
% Use the *Object Detector* block from the *Environments* section of the <matlab:mobileRoboticsLib 
% block library>. 
% 
% 
% 
% 
% 
% *Examples*
%% 
% * <matlab:mrsObjectModel Model with Object Detector block>
% * <matlab:mrsLidarAndObjectModel Model with Lidar Sensor and Object Detector 
% blocks>
% * <matlab:mrsObjectTrackingModel Object tracking logic example>
##### SOURCE END #####
--></body></html>